
<!doctype>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>一码通网上商城</title>
<meta name="keywords" content="一码通网上商城" />
<meta name="description" content="一码通网上商城" />
<style type="text/css">
.nc-appbar-tabs a.compare { display: none !important;}
</style>
<link rel="stylesheet" href="../css/reset.css">
<link rel="stylesheet" href="../css/common.css">
<link href="http://beian.80wlkj.com/shop/templates/default/css/base.css" rel="stylesheet" type="text/css">
<link href="http://beian.80wlkj.com/shop/templates/default/css/home_cart.css" rel="stylesheet" type="text/css">
<link href="http://beian.80wlkj.com/shop/resource/font/font-awesome/css/font-awesome.min.css" rel="stylesheet"/>
<link href="http://beian.80wlkj.com/shop/templates/default/css/home_header.css" rel="stylesheet" type="text/css">


<!--[if IE 7]>
  <link rel="stylesheet" href="http://beian.80wlkj.com/shop/resource/font/font-awesome/css/font-awesome-ie7.min.css">
<![endif]-->
<script src="http://beian.80wlkj.com/data/resource/js/jquery.js"></script>
<script type="text/javascript" src="../js/storage.js"></script>
<script type="text/javascript" src="../js/common.js"></script>
<script src="http://beian.80wlkj.com/data/resource/js/common.js"></script>
<script src="http://beian.80wlkj.com/data/resource/js/jquery-ui/jquery.ui.js"></script>
<script src="http://beian.80wlkj.com/data/resource/js/jquery.validation.min.js"></script>
<script src="http://beian.80wlkj.com/data/resource/js/jquery.poshytip.min.js"></script>
<script type="text/javascript" src="http://beian.80wlkj.com/data/resource/js/dialog/dialog.js" id="dialog_js" charset="utf-8"></script>
<script src="http://beian.80wlkj.com/data/resource/js/goods_cart.js"></script>
<!--[if lt IE 9]>
      <script src="http://beian.80wlkj.com/data/resource/js/html5shiv.js"></script>
      <script src="http://beian.80wlkj.com/data/resource/js/respond.min.js"></script>
<![endif]-->
<!--[if IE 6]>
<script src="http://beian.80wlkj.com/data/resource/js/IE6_PNG.js"></script>
<script>
DD_belatedPNG.fix('.pngFix');
</script>
<script>
// <![CDATA[
if((window.navigator.appName.toUpperCase().indexOf("MICROSOFT")>=0)&&(document.execCommand))
try{
document.execCommand("BackgroundImageCache", false, true);
   }
catch(e){}
// ]]>
</script>
<![endif]-->
</head>
<body>
<div class="public-top-layout w">
<div class="topbar wrapper">
<div class="user-entry">
您好 <span>
<span id="username"></span>
</span> ，欢迎来到 <a href="" title="首页" alt="首页"><span>一码通网上商城</span></a><span><span id="loginIn">[登录]</span> </span><span><span id="register">[注册]</span> </span> <span><span id="loginOut">[退出]</span> </span>
</div>
<div class="quick-menu">
<dl>
<dt><a href="http://beian.80wlkj.com/shop/index.php?act=show_joinin&op=index" title="免费开店">免费开店</a><i></i></dt>
<dd>
<ul>
<li><a href="http://beian.80wlkj.com/shop/index.php?act=show_joinin&op=index" title="招商入驻">招商入驻</a></li>
<li><a href="http://beian.80wlkj.com/shop/index.php?act=seller_login&op=show_login" target="_blank" title="登录商家管理中心">商家登录</a></li>
</ul>
</dd>
 </dl>
<dl>
<dt><a href="../view/orderList.html?act=member_order">我的订单</a><i></i></dt>
<dd>
<ul>
<li><a href="../view/orderList.html?act=member_order&state_type=state_new">待付款订单</a></li>
<li><a href="../view/orderList.html?act=member_order&state_type=state_send">待确认收货</a></li>
<li><a href="../view/orderList.html?act=member_order&state_type=state_noeval">待评价交易</a></li>
</ul>
</dd>
</dl>
</div>
</div>
</div>



<div class="header-wrap">
<header class="public-head-layout wrapper" style="width:1000px;">
<h1 class="site-logo"><a href="" style="display:block;;width:60%;margin:0 auto;"><img src="../imgs/index/logo.png" class="pngFix"></a></h1>
<ul class="ncc-flow">
<li class=""><i class="step1"></i>
<p>我的购物车</p>
<sub></sub>
<div class="hr"></div>
</li>
<li class=""><i class="step2"></i>
<p>填写核对购物信息</p>
<sub></sub>
 <div class="hr"></div>
</li>
<li class="current"><i class="step3"></i>
<p>支付提交</p>
<sub></sub>
<div class="hr"></div>
</li>
<li class=""><i class="step4"></i>
<p>订单完成</p>
<sub></sub>
<div class="hr"></div>
</li>
</ul>
</header>
</div>




<div class="ncc-wrapper">
<script src="http://beian.80wlkj.com/data/resource/js/common_select.js"></script>
<form method="post" id="order_form" name="order_form" action="index.php">
<div class="ncc-main">
<div class="ncc-title">
<h3>填写核对购物信息</h3>
<h5>请仔细核对填写收货、发票等信息，以确保物流快递及时准确投递。</h5>
</div>
<div id="addressBox" class="ncc-receipt-info">
<div class="ncc-receipt-info-title"><h3>收货人信息</h3></div>
   <div id="addr_list" class="ncc-candidate-items">
    <div id="hasAddr">
        <ul>
            <li>
                <span class="true-name"></span>
                <span class="address"></span>
                <span class="phone">
                    <i class="icon-mobile-phone"></i>
                </span>
                <span id="edit" style="color:#cc0000;cursor:pointer;">修改</span>&nbsp;&nbsp;
                <span id="del" style="cursor:pointer;">删除</span>
            </li>
        </ul>
    </div>
    <div id="noAddr">
        <ul>
            <li class="receive_add addr_item">
                <input value="0" type="radio" name="addr" checked>
                <label for="add_addr">使用新地址</label>&nbsp;</li>
                <div id="add_addr_box">
                    <div class="ncc-form-default">
                        <form method="" id="addr_form" action="">
                            <input type="hidden" value="buy" name="act">
                            <dl>
                                <dt>
                                    <i class="required">*</i>收货人姓名：
                                </dt>
                                <dd>
                                    <input type="text" class="text w100" name="true_name" maxlength="20" id="true_name" value="">
                                </dd>
                            </dl>
                            <dl>
                                <dt>
                                    <i class="required">*</i>所在地区：
                                </dt>
                                <dd>
                                    <div id="region">
                                        <select name="province" id="province">
                                            <option value="请选择">请选择</option>
                                        </select>
                                        <select name="city" id="city">
                                            <option value="请选择">请选择</option>
                                        </select>
                                        <select name="town" id="town">
                                            <option value="请选择">请选择</option>
                                        </select>

                                       </div>
                                   </dd>
                               </dl>
                               <dl>
                                <dt>
                                    <i class="required">*</i>详细地址：
                                </dt>
                                <dd>
                                    <input type="text" class="text w500" name="address" id="address" maxlength="80" value="">
                                    <p class="hint">请填写真实地址，不需要重复填写所在地区
                                    </p>
                                </dd>
                            </dl>
                            <dl>
                                <dt> 
                                    <i class="required">*</i>手机号码：
                                </dt>
                                <dd>
                                    <input type="text" class="text w200" name="mob_phone" id="mob_phone" maxlength="15" value="">
                                </dd>
                            </dl>
                        </form>
                    </div>
                </div>
            </ul>
            <div class="hr16"> 
                <a id="hide_addr_list" class="ncc-btn ncc-btn-red" href="javascript:void(0);">
                    保存收货人信息
                </a>
            </div>
    </div>
   </div>
</div>
<div class="ncc-receipt-info" id="paymentCon">
<div class="ncc-receipt-info-title">
<h3>支付方式</h3>
</div>
<div class="ncc-candidate-items">
<ul>
<li>在线支付</li>
</ul>
</div>
</div>
<div class="ncc-receipt-info">
<div class="ncc-receipt-info-title">
<h3>商品清单</h3>
<!-- <a href="index.php?act=cart">返回购物车</a> -->
</div>
<table class="ncc-table-style">
<thead>
<tr>
<th class="w20"></th>
<th></th>
<th>商品</th>
<th class="w120">单价(元)</th>
<th class="w120">数量</th>
<th class="w120">小计(元)</th>
</tr>
</thead>
<tbody>

</tbody>
<tfoot>
<tr>
<td colspan="20"><div class="ncc-all-account">订单总金额：<em id="orderTotal"></em>元</div></td>
</tr>
</tfoot>
</table>
</div>
<div class="ncc-bottom"> <a href="javascript:void(0)" id="submitOrder" class="ncc-btn ncc-btn-acidblue fr">提交订单</a> </div>
<input value="buy" type="hidden" name="act">
<input value="buy_step2" type="hidden" name="op">

<input value="1" type="hidden" name="ifcart">

<input value="online" name="pay_name" id="pay_name" type="hidden">

<input value="VfkEddRyKMgPLCHyH_mgzXuWekJd1fVQRBL" name="vat_hash" type="hidden">

<input value="4" name="address_id" id="address_id" type="hidden">

<input value="123" name="buy_city_id" id="buy_city_id" type="hidden">

<input value="0" id="allow_offpay" name="allow_offpay" type="hidden">
<input value="1:0" id="allow_offpay_batch" name="allow_offpay_batch" type="hidden">
<input value="Vue7k6tNV0svL8kwIDirPwOwezDl8AGtu2kge3I" id="offpay_hash" name="offpay_hash" type="hidden">
<input value="kC-O6REji4vacIzNYBBxXS-Ooe3xra-95zENlS7f3Kp7YNv" id="offpay_hash_batch" name="offpay_hash_batch" type="hidden">

<input value="" name="invoice_id" id="invoice_id" type="hidden">
<input value="" name="ref_url" type="hidden">
</div>
</form>
</div>
<div class="footer">
    <ul class="server">
        <li>
            <img src="../imgs/index/01.png">
        </li>
        <li>
            <img src="../imgs/index/02.png">
        </li>
        <li>
            <img src="../imgs/index/03.png">
        </li>
        <li>
            <img src="../imgs/index/04.png">
        </li>
    </ul>
    <ul class="firmInfo">
        <img class="firmInfo__logo" src="../imgs/index/logo.png">
        <div class="firmInfo__text">
            <div style="font-size:14px;color:#666;line-height:30px;">
                公司电话：
            </div>
            <div class="firmPhone">
                400-100-0000
            </div>
            <div class="firmArea">
                公司地址：杭州市萧山区金城路358号蓝爵国际写字楼
            </div>
        </div>
        <div class="firmInfo__QRCode">
            <img src="../imgs/index/logo.png">
            <p>了解更多</p>
        </div>
        
    </ul>
</div>
<script type="text/javascript" src="http://beian.80wlkj.com/data/resource/js/jquery.cookie.js"></script>
<link href="http://beian.80wlkj.com/data/resource/js/perfect-scrollbar.min.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="http://beian.80wlkj.com/data/resource/js/perfect-scrollbar.min.js"></script>
<script type="text/javascript" src="http://beian.80wlkj.com/data/resource/js/qtip/jquery.qtip.min.js"></script>
<link href="http://beian.80wlkj.com/data/resource/js/qtip/jquery.qtip.min.css" rel="stylesheet" type="text/css">
<script src="http://beian.80wlkj.com/shop/resource/js/compare.js"></script>
<script>
//提示信息
$('.tip').poshytip({
    className: 'tip-yellowsimple',
    showOn: 'hover',
    alignTo: 'target',
    alignX: 'center',
    alignY: 'top',
    offsetX: 0,
    offsetY: 5,
    allowTipHover: false
});
</script>
<script type="text/javascript">
    $(function(){
        var isAddr = false;
        if(!isAddr){
            $('#addressBox').addClass('current_box');
            
            $('#noAddr').show();
            $('#hasAddr').hide();
        }else{
            $('#addressBox').removeClass('current_box');
            $('#hasAddr').show();
            $('#noAddr').hide();
        }
    $(function(){
    $(".quick-menu dl").hover(function() {
        $(this).addClass("hover");
    },
    function() {
        $(this).removeClass("hover");
    });
    })

    $('#hide_addr_list').click(function(){
       getAddrInfo();
    });

    $('#edit').click(function(){
     $('#addressBox').addClass('current_box');
     $('#hasAddr').hide();
     $('#noAddr').show();
    })
    function getAddrInfo(){
        var url ='http://192.168.0.120:8080/ymshoping/address?token='+storage.getStorage('token')+'&recipient='+$('#true_name').val()+'&city='+ $('#province').val()+'-'+$('#city').val()+'-'+$('#town').val() +'&addressDetails='+$('#address').val()+'&phone='+$('#mob_phone').val();
        console.log(url,'&&&&&&&&');
         if ($('#true_name').val()==""){
            alert('收货人姓名不能为空');
            return false;
        }else if($('#address').val() == ""){
            alert('详细地址不能为空');
            return false;
        }else if($('#mob_phone').val()==""){
            alert('手机号不能为空');
            return false;
        }else if($('#province').val() == '请选择' || $('#city').val() == '请选择' || $('#town').val() == '请选择' ){
            alert('请重新选择您的省市区信息');
            return false;
        }
        
        $.ajax({
                url:url,
                dataType:'jsonp',
                jsonp:'callback',//传递给请求处理程序或页面的，用以获得jsonp回调函数名的参数名(默认为:callback)
                jsonpCallback:"success_jsonpCallback",//自定义的jsonp回调函数名称，默认为jQuery自动生成的随机函数名
                contentType: 'application/json; charset=utf-8',
                success:function(res){
                   $('#addressBox').removeClass('current_box');
                   $('#hasAddr').show();
                   $('#noAddr').hide();
                   $('.true-name').html(res.userName);

                   $('.address').html(res.address + '&nbsp;&nbsp;' + res.completeAddress);
                   $('.phone').html(res.phone);
                   $('#true_name').val(res.userName);
                   $('#address').val(res.completeAddress);
                   $('#mob_phone').val(res.phone);
                   $('#addr_list').data('addrId',res.addressId);
            },
            error:function(res){
                console.log(res);
            }
        });
    
    }
})

</script>
<script type="text/javascript" src="../js/area.js"></script>
<script type="text/javascript" src="../js/select.js"></script>
<script type="text/javascript">

 
</script>

<script type="text/javascript">
    $(function(){
        var username = storage.getStorage('username')||'';
        $('#username').html(username);
        if(!username){
            $('#loginIn').show();
            $('#register').show();
            $('#loginOut').hide();
        }else{
            $('#loginIn').hide();
            $('#register').hide();
            $('#loginOut').show();
        }
        $('#loginIn').click(function(){
            window.location.href = "./login.html"
        })
        $('#register').click(function(){
            window.location.href = "./register.html"
        })
        $('#loginOut').click(function(){
            storage.storageClear();
            window.location.href = "./login.html"
        })
        $('.goodsList ul li').click(function(){
            var href = './goodsDetail.html?id=' + this.id;
            window.location.href = href;
        })
    })
</script>
<script type="text/javascript">
    $(function(){
        var url = 'http://192.168.0.120:8080/ymshoping/getJSON?token='+storage.getStorage('token');
         $.ajax({
                url:url,
                dataType:'jsonp',
                jsonp:'callback',//传递给请求处理程序或页面的，用以获得jsonp回调函数名的参数名(默认为:callback)
                jsonpCallback:"success_jsonpCallback",//自定义的jsonp回调函数名称，默认为jQuery自动生成的随机函数名
                contentType: 'application/json; charset=utf-8',
                success:function(res){
                   console.log(res);
                   if (res.code == 0) {
                    var shopsList = res.shopsList;
                    var shopsListStr ='';
                    var goodsListStr = '';

                    shopsList.forEach(function(item,index){
                        item.shopGoods.forEach(function(val,idx){
                            goodsListStr +=  '</tr><tr id="cart_item_1" class="shop-list "><td> <input type="hidden" value="1|1" name="cart_id[]"></td><td class="w60"><a href="http://beian.80wlkj.com/shop/index.php?act=goods&amp;op=index&amp;goods_id=52" target="_blank" class="ncc-goods-thumb"><img src="http://192.168.0.120:8080/ymshoping/pic?picId='+val.picId+'" alt=""></a></td><td class="tl"><dl class="ncc-goods-info"><dt><a href="./index.html?goodsId='+val.goodsId+'" target="_blank">'+val.goodsName+'</a></dt></dl></td><td class="w120"><em>'+val.mall+'</em></td><td class="w60">'+val.amount+'</td><td class="w120"> <em id="item1_subtotal" nc_type="eachGoodsTotal">'+val.mall+'</em></td><td></td></tr><tr><td class="w10"></td><td class="tl" colspan="10"><div class="ncc-form-default"> </div></td></tr><tr><td class="tr" colspan="20"><div class="ncc-store-account"><dl class="freight"><dt>运费：</dt><dd><em id="eachStoreFreight_1">0.00</em>元</dd></dl><dl><dt>商品金额：</dt><dd><em id="eachStoreGoodsTotal_1">'+val.mall+'</em>元</dd></dl>'
                        })
                          shopsListStr += '<tr><th colspan="20"><strong>店铺：<a href="javascript" id="shopName">'+item.shopsName+'</a></strong> <span member_id="1"></span><div class="store-sale"></div></th>'+goodsListStr+'<dl class="total"><dt>本店合计：</dt><dd><em store_id="1" nc_type="eachStoreTotal">'+item.shopsMoney+'</em>元</dd></dl></div></td></tr>';
                    })
                    $('.ncc-table-style tbody').html(shopsListStr);

                    $('#orderTotal').html(parseFloat(res.allMoney).toFixed(2));
                   }
                },
                error:function(res){
                    console.log(res.responseText);
                }
        });
    })

</script>
<script type="text/javascript">
    function submitNext(){
    var addrId = $('#addr_list').data('addrId');
    if(addrId === 'undefined'){
        alert('请填写您的收货人信息');
        return false;
    }
    var url = 'http://192.168.0.120:8080/ymshoping/addOrder?token='+storage.getStorage('token')+'&addressId='+addrId;
    $.ajax({
                url:url,
                dataType:'jsonp',
                jsonp:'callback',//传递给请求处理程序或页面的，用以获得jsonp回调函数名的参数名(默认为:callback)
                jsonpCallback:"success_jsonpCallback",//自定义的jsonp回调函数名称，默认为jQuery自动生成的随机函数名
                contentType: 'application/json; charset=utf-8',
                success:function(res){
                    if (res.code == 0) {
                        window.location.href ="./pay.html";
                    }
                },
                error:function(res){
                    console.log(res.responseText);
                }
        });

}
$(function(){
    $(document).keydown(function(e) {
        if (e.keyCode == 13) {
            submitNext();
            return false;
        }
    });
    $('#submitOrder').on('click',function(){submitNext()});
});
</script>
</body>
</html>
